
<include file="__THEME__/header" />

<link href="../Public/notify.css" rel="stylesheet" type="text/css" />

<script>
    function agreeFri(fuid,nid){
        Win({message:'__APP__/Friend/isAdd/uid/'+fuid+'/nid/'+nid+'/t/agree',width:392,height:220,title:'加为好友',handler:function(){ymPrompt.close();},autoClose:false,iframe:true,allowRightMenu:true});
    }

    function ignoreFri(uid,nid){
        Confirm({message:'确认忽略这条好友请求?',handler:function(tp){
                if(tp=='ok'){
                    $.post(APP+"/Friend/ignoreFriend",{nid:nid,uid:uid},function(txt){
                        if(txt == 1){
                            Alert("忽略成功!");
                            setTimeout(function(){ parent.ymPrompt.close(); },1500);
                            location.reload();
                        }else{
                            Alert("忽略失败!");
                        }
                    });
                }
                if(tp=='cancel'){
                    ymPrompt.close();
                }
                if(tp=='close'){
                    ymPrompt.close();
                }
            }});
    }

    function set_group(fuid,nid){
        Win({message:'__APP__/Friend/setGroup/fuid/'+fuid+'/nid/'+nid,width:392,height:220,title:'加为好友',handler:function(){ymPrompt.close();},autoClose:false,iframe:true,allowRightMenu:true});
    }

    //删除某条动态
    function del_notify(id) {
        $.post(URL+"/del_notify",{id:id},function(txt){
            if(txt == 1){
                $("#notify_"+id).hide("slow");
             }else{
                Error("删除失败!");
             }
        });
    }


</script>
<div class="content"><!-- 内容 begin  -->

    <div class="main"><!-- 画布 begin  -->



        <div class=page_title> <!-- page_title begin -->
            <h2><img src="../Public/images/computer.gif" />消息</h2>
        <div class="c"></div>
</div><!-- page_title end -->
        <div class="tab-menu"><!-- 切换标签 begin  -->
            <ul>
                <li><a href="__URL__/inbox"><span>收件箱</span></a></li>
                <li><a href="__URL__/send"><span>发件箱</span></a></li>
                <li><a href="__URL__/index" class="on"><span>通知</span></a></li>
                <li><a href="__URL__/write"><span><div class="ico_add">&nbsp;</div>写短消息</span></a></li>
            </ul>
        </div><!-- 切换标签 end  -->




        <div class="BlogBox">
            <div class="sidebar pt10">
			<div class="FSort">
			<div class="tit">通知类别</div>
                <ul>
                    <li <php>if(!$_GET['t']){echo 'class="on"';}</php>><a href="__URL__">全部通知</a></li>
                    <li <php>if($_GET['t']=='sys'){echo 'class="on"';}</php>><a href="__URL__/index/t/sys">系统通知</a></li>
                    <li <php>if($_GET['t']=='fri'){echo 'class="on"';}</php> ><a href="__URL__/index/t/fri">好友请求</a></li>
                    <li><a href="#">应用通知</a></li>
                </ul>
				<div class="btm"></div>
				</div>
            </div>
            <div class="MList" style="width:640px;"><!-- 通知列表 begin  -->
                <ul>


                    <volist name="notifys" id="notify">
                        <li class="btmlineD" id="notify_{$notify.id}">
                            <div class="left" style="width:10%">
                                      <span class="headpic50">
                                    <php>if($notify['authorid']!=0){</php>
                                  <a href="__APP__/space/{$notify.authorid}" class="tips" rel="__TS__/Index/userInfo/uid/{$notify['authorid']}">
                                                <img src="{$notify.authorid|getUserFace}" alt="{$notify.author}" />
                                  </a>

                                    <php>}else{</php>
                                               <img src="{$notify.authorid|getUserFace}" alt="{$notify.author}" />
                                    <php>}</php>
                                                      </span>
                            </div>
                            <div class="left" style="width:90%">
                                <h3><div class="right alR"><div class="left"><em>{$notify.cTime|friendlyDate='full'}</em></div><div class="left"><a href="javascript:del_notify({$notify.id})" class="del" style=" margin:4px 0 0 0;">删除</a></div></div><strong>{$notify.type_cn}：</strong></h3>
							<div>
							<div class="right alR">
									<!-- TIP -->
                                    <php>
                                        if($notify["new"]>=2 &&  $notify["deal"]){
                                        echo '<div class="tip">';
                                            $deal = explode("|",$notify["deal"]);
                                            echo  ($notify["new"] == 2)?$deal[0]:$deal[1];
                                        echo '</div>';
                                        }
                                    </php>
                                    <!-- TIP END -->
                                </div>
                                <p>{$notify.title}</p>
                                <p>{$notify.body}</p>
							</div>
                                <!-- URL -->
                                <div class="lh35" style="margin-top:10px;">
                                    <lt name="notify.new" value="2">
                                    <php>if($notify['type'] == "add_friend"){</php>
                                    <a href="javascript:agreeFri({$notify.url},{$notify.id});">同意</a> | <a href="javascript:ignoreFri({$notify.url},{$notify.id});">忽略</a>
                                    <php>}elseif($notify['type'] == "agree_friend"){</php>
                                <a href="javascript:set_group({$notify.authorid},{$notify.id})">设置好友分组</a>
                                <php>}elseif($notify["url"]){</php>
                                <a href="{$notify.url}">去看看</a>
                                <php>}</php>
                                </lt>
                                </div>
                                <!-- URL END -->




                            </div>
							<div class="c"></div>
                        </li>
                    </volist>
                </ul>

                <php>echo page($total_page);</php>

            </div><!-- 通知列表 end  -->
        </div>








    </div><!-- 画布 end  -->
  <div class="c"></div>
</div><!-- 内容 end -->
<include file="__THEME__/footer" />
